package com.sun.spring5.annotations;

import org.springframework.context.annotation.*;
import org.springframework.context.annotation.ComponentScan.Filter;

@Configuration
public class MyConfig2 {
    @Scope(value = "singleton")
    @Bean(name = "person",initMethod = "init",destroyMethod = "detory")
    public Person person(){
        System.out.println("容器创建完成");
        return new Person("张三",20);
    }
}
